
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@eth-optimism/core-utils
Advanced tools
[Optimism] Core typescript utilities
@eth-optimism/core-utils is a utility library for working with the Optimism Layer 2 scaling solution for Ethereum. It provides various tools and utilities to facilitate the development and interaction with the Optimism network.
Merkle Tree Utilities
This feature allows you to create and manipulate Merkle Trees, which are essential for various cryptographic proofs in blockchain technology.
const { MerkleTree } = require('@eth-optimism/core-utils');
const elements = ['a', 'b', 'c'];
const tree = new MerkleTree(elements);
const root = tree.getRoot();
console.log('Merkle Root:', root);
Hexadecimal Utilities
Provides utilities for converting between hexadecimal strings and buffers, which is useful for encoding and decoding data in Ethereum transactions.
const { toHexString, fromHexString } = require('@eth-optimism/core-utils');
const hexString = toHexString(Buffer.from('hello'));
console.log('Hex String:', hexString);
const buffer = fromHexString(hexString);
console.log('Buffer:', buffer.toString());
Address Utilities
Includes functions for validating and formatting Ethereum addresses, ensuring they are correctly checksummed.
const { isAddress, getAddress } = require('@eth-optimism/core-utils');
const address = '0x1234567890abcdef1234567890abcdef12345678';
console.log('Is Address:', isAddress(address));
console.log('Checksummed Address:', getAddress(address));
ethereumjs-util is a collection of utility functions for Ethereum, including functions for working with addresses, buffers, and cryptographic operations. It is similar to @eth-optimism/core-utils but is more general-purpose and not specifically tailored for the Optimism network.
web3-utils is part of the Web3.js library and provides a wide range of utility functions for Ethereum development, such as encoding/decoding data, working with addresses, and handling big numbers. It offers broader functionality compared to @eth-optimism/core-utils, which is more focused on Optimism-specific utilities.
ethers is a complete Ethereum library and includes a variety of utility functions for interacting with the Ethereum blockchain, including address manipulation, data encoding/decoding, and cryptographic operations. It is more comprehensive than @eth-optimism/core-utils and is widely used in the Ethereum development community.
@eth-optimism/core-utils
contains the Optimistic Virtual Machine core utilities.
After cloning and switching to the repository, install dependencies:
$ pnpm i
Use the following commands to build, use, test, and lint:
$ pnpm build
$ pnpm start
$ pnpm test
$ pnpm lint
FAQs
[Optimism] Core typescript utilities
The npm package @eth-optimism/core-utils receives a total of 151,917 weekly downloads. As such, @eth-optimism/core-utils popularity was classified as popular.
We found that @eth-optimism/core-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.